package cn.kn.triage.zdx.controller;

import cn.kn.triage.common.model.R;
import cn.kn.triage.zdx.manualmapper.AllinOne;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("zdx/shift")
public class ShiftController {
    private final AllinOne allinOne;


    public ShiftController(AllinOne allinOne) {
        this.allinOne = allinOne;
    }

    @GetMapping("/{startdate}&{enddate}&{deptid}")
    public R shiftList(@PathVariable String startdate, @PathVariable String enddate, @PathVariable String deptid){
        return R.ok(allinOne.extractShift(startdate, enddate, deptid));
    }

    @GetMapping("/doc/{deptid}")
    public R getDoc(@PathVariable String deptid){
        return R.ok(allinOne.doctorlist(deptid));
    }

    @GetMapping("/dept")
    public R getDept(){
        return R.ok(allinOne.deptlist());
    }
}
